package tests;

import static org.junit.Assert.assertEquals;

import org.junit.Test;

import coreSimulation.Baggage;

public class BaggageTest {

	Baggage b;

	@Test(expected = IllegalStateException.class)
	public void testBaggageInvalidWidth() {
		b = new Baggage(0, 1, 1, 1); // width too small

	}

	@Test(expected = IllegalStateException.class)
	public void testBaggageInvalidHeight() {
		b = new Baggage(1, 0, 1, 1); // height too small

	}

	@Test(expected = IllegalStateException.class)
	public void testBaggageInvalidDepth() {
		b = new Baggage(1, 1, 0, 1); // width too small

	}

	@Test(expected = IllegalStateException.class)
	public void testBaggageWeightTooSmall() {
		b = new Baggage(1, 1, 1, 0); // weight too small

	}

	@Test(expected = IllegalStateException.class)
	public void testBaggageWeightTooLarge() {
		b = new Baggage(1, 1, 1, 26.1); // weight too large

	}

	@Test
	public void testGetWidth() {
		b = new Baggage(10, 15, 20, 25.1);
		assertEquals("The getWidth method failed.", 10, b.getWidth());
	}

	@Test
	public void testGetHeight() {
		b = new Baggage(10, 15, 20, 25.1);
		assertEquals("The getWidth method failed.", 15, b.getHeight());
	}

	@Test
	public void testGetDepth() {
		b = new Baggage(10, 15, 20, 25.1);
		assertEquals("The getWidth method failed.", 20, b.getDepth());
	}

	@Test
	public void testGetWeight() {
		b = new Baggage(10, 15, 20, 25.1);
		assertEquals("The getWidth method failed.", 25.1, b.getWeight(), 0);
	}

}
